package com.safone.thirdattendanceservices.classroom.controllers;


import com.safone.thirdattendanceservices.classroom.services.ClassRoomAttendanceDataService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 第三方班级考勤数据接口
 * @author xy
 * @date 2020/12/4 20:16
 */
@RestController
@AllArgsConstructor
@RequestMapping(value = "/api/safe/external/open/dh")
public class ClassRoomAttendanceDataController {

    private ClassRoomAttendanceDataService classRoomAttendanceDataService;

    /**
     * 查询某个学生行为汇总数据
     * @param
     * @return
     */
    @GetMapping(value = "/studentBehavior/find/one")
    public Object findOneStudentBehavior(){
        return classRoomAttendanceDataService.findOneStudentBehavior();
    }

    /**
     * 查询指定班级指定课程的学生行为汇总数据
     * @param
     * @return
     */
    @GetMapping(value = "/studentBehavior/find/list")
    public Object findStudentBehaviorList(){
        return classRoomAttendanceDataService.findStudentBehaviorList();
    }

    /**
     * 根据时间范围或年份查询班级考勤数据
     * @param classId
     * @return
     */
    @GetMapping(value = "/classAttendance/find")
    public Object findClassAttendanceByDate(@RequestParam(value = "classIds") String classId){
        return classRoomAttendanceDataService.findClassAttendanceByDate(classId);
    }

    /**
     * 根据名称模糊查询学籍信息，返回信息包含上级节点
     * @return
     */
    @GetMapping(value = "/school/roll/find8name")
    public Object findSchoolRollByName(){
        return classRoomAttendanceDataService.findSchoolRollByName();
    }

    /**
     * 获取学籍树
     * @return
     */
    @GetMapping(value = "/school/roll/get")
    public Object getSchoolRoll(){
        return classRoomAttendanceDataService.getSchoolRoll();
    }

    /**
     * 获取组织
     * @return
     */
    @GetMapping(value = "/organization/find")
    public Object findOrganization(){
        return classRoomAttendanceDataService.findOrganization();
    }

    /**
     * 获取课程
     * @return
     */
    @GetMapping(value = "/lesson/find")
    public Object findLesson(){
        return classRoomAttendanceDataService.findLesson();
    }
}
